package com.example.classcommunity3.controller;

import com.example.classcommunity3.service.ClasstableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/classtable")
public class ClasstableController {

    @Autowired
    ClasstableService classtableService;

    //加入课程（添加到数据库）
    @RequestMapping(params = "method=joinSub")
    public boolean joinSub(String subCode,Long account){
        boolean b = false;
        b = classtableService.joinSub(subCode, account);

        return b;
    }

    //获得已加入的课程信息（传到前端）
    @RequestMapping(params = "method=getAllStuSub")
    public String getAllStuSub(Long account){
        return classtableService.getAllStuSub(account);
    }
}
